import Page
from Page import SmartHome
from Base.Base import Base
from selenium.webdriver.common.by import By


class SmartHomeYunmiIndexPage(Base):
    """
    云米首页(与小米首页共用)

    """

    def __init__(self, driver):
        Base.__init__(self, driver)

        # 左侧的home键
        self.yunmi_index_home_btn = (By.XPATH, SmartHome.RESOURCE_ID.format("ivHome"))

        # 左侧的返回键
        self.yunmi_index_back_btn = (By.XPATH, SmartHome.RESOURCE_ID.format('ivBack'))

        # 标题
        self.yunmi_index_title_text = (By.XPATH, SmartHome.RESOURCE_ID.format('tv_title'))

    def get_index_title(self):
        """
        获取云米首页

        :return:
        """
        return self.find_element_o(self.yunmi_index_title_text)
